﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserForm.ascx.cs" Inherits="SalesManagement.Controls.Sales.UserForm" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Store ID="storeRole" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="RoleId">
            <Fields>
                <ext:RecordField Name="RoleId" />
                <ext:RecordField Name="RoleName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Store ID="storeEmployee" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="EmployeeId">
            <Fields>
                <ext:RecordField Name="EmployeeId" />
                <ext:RecordField Name="EmployeeCode" />
                <ext:RecordField Name="EmployeeName" />
                <ext:RecordField Name="Address" />
                <ext:RecordField Name="TaxCode" />
                <ext:RecordField Name="BranchId" />
                <ext:RecordField Name="Department" />
                <ext:RecordField Name="PositionId" />
                <ext:RecordField Name="Phone" />
                <ext:RecordField Name="Mobile" />
                <ext:RecordField Name="Fax" />
                <ext:RecordField Name="Website" />
                <ext:RecordField Name="Email" />
                <ext:RecordField Name="IsActive" />
                <ext:RecordField Name="CreatedDate" />
                <ext:RecordField Name="CreatedBy" />
                <ext:RecordField Name="UpdatedDate" />
                <ext:RecordField Name="UpdatedBy" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Window ID="winDetails" runat="server" Title="Chi tiết Kho hàng" Frame="false"
    Hidden="true" CenterOnLoad="true" Width="400" Height="100" BodyStyle="padding:5px 0px 0px 20px;" Resizable="false"
    Closable="true" Layout="Fit" AutoHeight="true" Icon="Group">
    <Items>
        <ext:FormPanel ID="FormPanel1" runat="server" Header="false" LabelWidth="90" AutoHeight="true"
            Border="false" MonitorValid="true" BodyStyle="background-color:transparent;"
            Layout="FormLayout">
            <Items>                
            <ext:Hidden ID="hdfUserName" runat="server" />
                <ext:TextField ID="txtUserName" runat="server" FieldLabel="Tên đăng nhập" AnchorHorizontal="93%" AllowBlank="false" BlankText="Không để trống" MsgTarget="Side"/>                
                <ext:TextField ID="txtPassword" runat="server" FieldLabel="Mật khẩu" InputType="Password"
                    Anchor="93%" AllowBlank="false" BlankText="Không để trống" MsgTarget="Side"/>
                <ext:TextField ID="txtConfirmPassword" runat="server" FieldLabel="Nhắc lại" InputType="Password"
                    AnchorHorizontal="93%" Vtype="password" VtypeText="Mật khẩu không giống nhau" AllowBlank="false" BlankText="Không để trống" MsgTarget="Side">
                    <CustomConfig>
                        <ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value" />
                    </CustomConfig>
                </ext:TextField>
                <ext:ComboBox ID="cbbRole" runat="server" FieldLabel="Quyền" AnchorHorizontal="93%"
                    StoreID="storeRole" DisplayField="RoleName" ValueField="RoleId" EmptyText="Chọn Quyền" AllowBlank="false" BlankText="Không để trống" MsgTarget="Side"/>
                <ext:ComboBox ID="cbbEmployee" runat="server" FieldLabel="Nhân viên" AnchorHorizontal="93%"
                    StoreID="storeEmployee" DisplayField="EmployeeName" ValueField="EmployeeId" EmptyText="Chọn Nhân viên" AllowBlank="false" BlankText="Không để trống" MsgTarget="Side"/>
                <ext:CheckboxGroup ID="CheckboxGroup2" runat="server" FieldLabel="Kích hoạt">
                    <Items>
                        <ext:Checkbox ID="ckbIsActive" runat="server" Checked="true" />
                    </Items>
                </ext:CheckboxGroup>                
            </Items>
            <Listeners>
                <ClientValidation Handler="#{btnSave}.setDisabled(!valid);" />
            </Listeners>
        </ext:FormPanel>
    </Items>
    <Buttons>
        <ext:Button ID="btnSave" runat="server" Text="Lưu" Icon="Disk">
            <DirectEvents>
                <Click OnEvent="btnSave_Click" />
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="btnCancel" runat="server" Text="Đóng" Icon="Cancel">
            <Listeners>
                <Click Handler="#{winDetails}.hide();" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
